package cn.itcast.quartz;

import cn.itcast.service.PromotionService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Date;

public class PromotionJob implements Job {
    @Autowired
    private PromotionService promotionService;

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        Date now = new Date();
        promotionService.updataStatus(now);
        System.out.println("定时任务正在执行"+now);
    }
}
